package com.baba.vote.util;

/**
 * @auther moxinHuoHuo
 * @createDate 2019/9/10 15:02
 */
public class StringSpitUtil {


    public static String cutFileNameAccordingToPath(String filePath) {

        int index = filePath.lastIndexOf("\\");

        if (index == -1) {

            index = filePath.lastIndexOf("/");
        }

        return filePath.substring(index + 1);
    }

    public static String cutFileSuffix(String filePath) {

        int index = filePath.lastIndexOf(".");

        return filePath.substring(index);
    }

}
